package net.lcqf.tcp.server;

import io.netty.channel.Channel;
import io.netty.channel.group.ChannelMatcher;

/**
 * 发送消息给指定的用户
 * +----------------------------------------------------------------------
 * | Talk To [ 聊来改善地区金融服务环境，助力企业发展 ]
 * +----------------------------------------------------------------------
 * | Copyright (c) 2018-2025 聊来All rights reserved.
 * +----------------------------------------------------------------------
 * | Licensed ( <a href="http://www.apache.org/licenses/LICENSE-2.0">apache</a> )
 * +----------------------------------------------------------------------
 * | @Author: 聊来 <18970881148@qq.com>
 * +----------------------------------------------------------------------
 * | DateTime: 2025/3/9 00:11
 * +----------------------------------------------------------------------
 */
public class NettyMatcher implements ChannelMatcher {

    private final String id;

    public NettyMatcher(String id) {
        this.id = id;
    }

    @Override
    public boolean matches(Channel channel) {
        return channel.id().asShortText().equals(this.id);
    }
}
